using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using CMSApplication.Models.Mapping;

namespace CMSApplication.Models
{
    public class CMSContext : DbContext
    {
        static CMSContext()
        {
            Database.SetInitializer<CMSContext>(null);
        }

		public CMSContext()
			: base("Name=CMSContext")
		{
		}

        public DbSet<Content> Contents { get; set; }
        public DbSet<HtmlElement> HtmlElements { get; set; }
        public DbSet<Site> Sites { get; set; }
        public DbSet<sysdiagram> sysdiagrams { get; set; }
        public DbSet<ResourceModel> Resources { get; set; }
        public DbSet<Version> Versions { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new ContentMap());
            modelBuilder.Configurations.Add(new HtmlElementMap());
            modelBuilder.Configurations.Add(new SiteMap());
            modelBuilder.Configurations.Add(new sysdiagramMap());
            modelBuilder.Configurations.Add(new ResourceMap());
            modelBuilder.Configurations.Add(new VersionMap());
        }
    }
}
